<template>
  <div>
    <a @click="handleEdit(record)" v-has="'user:research-operate'">编辑</a>
    <a-divider type="vertical" />
    <a-dropdown>
      <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
      <a-menu slot="overlay">
        <a-menu-item>
          <a @click="handleDetail(record)">详情</a>
        </a-menu-item>
        <a-menu-item v-has="'user:research-operate'">
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </a-menu-item>
      </a-menu>
    </a-dropdown>
  </div>
</template>

<script>
export default {
  name: "researchTableActionComponment",
  props:{
    record: {
      type: Object,
      default: {}
    }
  },
  methods: {
    handleEdit(record){
      console.log('handleEdit:', record )
      this.$emit( 'handleEdit', record );
    },
    handleDetail(record){
      console.log('handleDetail:', record )
      this.$emit( 'handleDetail', record );
    },
    handleDelete(id){
      console.log('handleDelete:', id )
      this.$emit( 'handleDelete', id);
    },
  }
}
</script>

<style scoped>

</style>